package com.glsc.ngateway.platform.controller.glres;

import com.glsc.ngateway.common.api.flowable.feign.IFeignFlowableService;
import com.glsc.ngateway.common.api.platform.resp.PlatformResponse;
import com.glsc.ngateway.platform.domain.Vpn;
import com.glsc.ngateway.platform.service.glres.GlscVpnService;
import com.glsc.ngateway.platform.utils.RequestTool;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/vpn")
@Api(value = "vpn接口", tags = {"vpn接口"})
public class GlscVpnController {

    Logger logger = LoggerFactory.getLogger(this.getClass());

    private static int default_page_number = 1;
    private static int default_page_size = 10;


    @Resource
    private IFeignFlowableService feignDemandService;

    @Resource
    private GlscVpnService glscVpnService;

//    @Resource
//    private GiteeNewService giteeNewService;
//
//    @Resource
//    private TokenUtil tokenUtil;
//
    @Resource
    private RequestTool requestTool;
//
//    @Resource
//    private FlowCommonService flowCommonService;
//
//    @Value("${demand.downloadUrl}")
//    String downloadUrl;


    @ApiOperation(value = "分页查询", notes = "分页查询")
    @RequestMapping("/page")
    public PlatformResponse<Page<Vpn>> getProcessSituationPage(
            @ApiParam(value = "查询参数") @RequestBody(required = true) Vpn paramSearchDto) {
        logger.info("分页查询");
        String operatorStart = requestTool.getAccountFromRequest();
        Page<Vpn> page = glscVpnService.getProcessSituationPage(paramSearchDto.getPageNo(), paramSearchDto.getPageSize(), paramSearchDto, operatorStart);
        return PlatformResponse.successData(page);
    }

}
